<template>
  <div class="button-row">
    <slot></slot>
    <template v-for="(item,i) of permiList">
      <el-button size="mini"
                 @click="openDialog(item.funcCode)"
                 :key="i"
                 :type="item.colour"
                 v-if="item && !(item.funcCode == 'Authorized' || item.funcCode == 'Inquire')"
                 :icon="item.icon">
        {{item.funcName}}
      </el-button>
    </template>
  </div>
</template>

<script>
export default {
  props: {
    permiList: Array,   // 权限数组
    single: {
      default: false
    }
  },
  data() {
    return {

    }
  },
  methods: {
    // 传父组件boolean 打开弹窗
    openDialog(val) {
      let params = {
        show: true,
        type: val
      }
      this.$emit('dialogShow', params)
    },
  }
}
</script>

<style lang="scss" scoped>
.button-row{
  .el-button{
    margin-bottom: 5px;
    margin-left: 0;
    margin-right: 10px;
  }
}
</style>